module Enumerable

  def take_while
    results = []
    each do |element|
      break unless yield(element)
      results << element
    end
    results
  end if RUBY_VERSION < '1.9'

end
